package com.forstudy.wiki.controller;

import com.forstudy.wiki.req.EbookReq;
import com.forstudy.wiki.resp.CommonResp;
import com.forstudy.wiki.resp.EbookResp;
import com.forstudy.wiki.service.EbookService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;


@RestController
@RequestMapping("/ebook")
public class EbookController {
    private static final Logger LOG = LoggerFactory.getLogger(EbookController.class);

    @Autowired
    private EbookService ebookService;

    @RequestMapping("/list")
    public CommonResp List(EbookReq req) {
        CommonResp<List<EbookResp>> resp = new CommonResp<>();
        resp.setContent(ebookService.list(req));
        return resp;
    }
}

